package com.ran.patterns.factoryMethod.generalFactory.core;

import com.ran.patterns.factoryMethod.forCore.MailSender;
import com.ran.patterns.factoryMethod.forCore.Sender;
import com.ran.patterns.factoryMethod.forCore.SmsSender;



public class GerneralFactory {
	public static Sender getSender(String sender) {
		if (sender.equals("mail")) {
			return new MailSender();
		}else if (sender.equals("sms")) {
			return new SmsSender();
		}else {
			System.out.println("请输入正确的类型");
			return null;
		}
	}
}
